package base.Chapter00_Structures.C03_LinkList;

/**
 * 作用: 带泛型的双向链表
 * @param <T> 数据类型
 */
public class DoubleLinkedListNode<T> {
    private T data;
    private DoubleLinkedListNode preNode;
    private DoubleLinkedListNode nextNode;

    public DoubleLinkedListNode(T data) {
        this.data = data;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public DoubleLinkedListNode getPreNode() {
        return preNode;
    }

    public void setPreNode(DoubleLinkedListNode preNode) {
        this.preNode = preNode;
    }

    public DoubleLinkedListNode getNextNode() {
        return nextNode;
    }

    public void setNextNode(DoubleLinkedListNode nextNode) {
        this.nextNode = nextNode;
    }

    @Override
    public String toString() {
        return "DoubleLinkList{" +
                "data=" + data +
                '}';
    }
}
